<?php 

if($ListingID != 0)
{
$sql = "Select count(ID) as total from Listing_Images where Listing_ID = '".$ListingID."' and Type = 'IMAGE'";
$result = mysql_query($sql) or die ("SQL Error".mysql_error());
$row=mysql_fetch_assoc($result);
$numphotos = $row['total'];
}
else
{
$numphotos = 0;
}

$sql2 = "Select count(ID) as total from Listing_Images where Listing_ID = '".$ListingID."' and Type = 'VT'";
$result2 = mysql_query($sql2) or die ("SQL Error".mysql_error());
$row2=mysql_fetch_assoc($result2);?>

<?php 
if($edit === 'events')
{
?>
<div id="invertedtabs">
		<ul>
		<li id="current" style="margin-left: 1px"><a href=new_listing.php><span>Enter Listing Details </span></a></li>
		<li><a href=edit_photos_listings.php?listing_id=<?php echo $ListingID ?>><span>(<?php echo $numphotos ?>) Photos </span></a></li>
		<li><a href=edit_events.php?listing_id=<?php echo $ListingID ?>><span>Open Houses</span></a></li>	
		<li><a href=view_analytic.php?listing_id=<?php echo $ListingID ?>><span>Analytics</span></a></li>	
		<!--<li><a href=../poster/account/view_templates.php?listing_id=<?php /*?><?php echo $ListingID ?><?php */?>><span>Create a Flyer</span></a></li>-->
        <!--<li><a href=add_new_propblog.php?listingid=<?php /*?><?php echo $ListingID ?><?php */?>><span>Start a Blog</span></a></li>	-->
		</ul>
</div>
<?php 
}
?>

<?php 
if($edit === 'details')
{
?>
<div id="invertedtabs">
		<ul>
		<li id="current" style="margin-left: 1px"><a href=edit_listing.php?listing_id=<?php echo $ListingID ?>><span>Listing Details </span></a></li>
		<li><a href=edit_photos_listings.php?listing_id=<?php echo $ListingID ?>><span>(<?php echo $row['total'] ?>) Photos </span></a></li>
		
		
		<li><a href=edit_events.php?listing_id=<?php echo $ListingID ?>><span>Open Houses</span></a></li>	
		<li><a href=preview.php?listing_id=<?php echo $ListingID ?>><span>Preview</span></a></li>	
		<li><a href=view_analytic.php?listing_id=<?php echo $ListingID ?>><span>Analytics</span></a></li>	
		</ul>
</div>
<?php 
}
?>

<?php 
if($edit === 'photos')
{
?>
<div id="invertedtabs">
		<ul>
		<li style="margin-left: 1px"><a href=edit_listing.php?listing_id=<?php echo $ListingID ?>><span>Listing Details </span></a></li>
		<li id="current"><a href=edit_photos_listings.php?listing_id=<?php echo $ListingID ?>><span>(<?php echo $row['total'] ?>) Photos </span></a></li>
		
		
		<li><a href=edit_events.php?listing_id=<?php echo $ListingID ?>><span>Open Houses</span></a></li>	
		<li><a href=preview.php?listing_id=<?php echo $ListingID ?>><span>Preview</span></a></li>	
		<li><a href=view_analytic.php?listing_id=<?php echo $ListingID ?>><span>Analytics</span></a></li>	
		</ul>
</div>
<?php 
}
?>

<?php 
if($edit === 'vt')
{
?>
<div id="invertedtabs">
		<ul>
		<li style="margin-left: 1px"><a href=edit_listing.php?listing_id=<?php echo $ListingID ?>><span>Listing Details </span></a></li>
		<li><a href=edit_photos_listings.php?listing_id=<?php echo $ListingID ?>><span>(<?php echo $row['total'] ?>) Photos </span></a></li>
		
		
		<li><a href=edit_events.php?listing_id=<?php echo $ListingID ?>><span>Open Houses</span></a></li>	
		<li><a href=preview.php?listing_id=<?php echo $ListingID ?>><span>Preview</span></a></li>	
		<li><a href=view_analytic.php?listing_id=<?php echo $ListingID ?>><span>Analytics</span></a></li>	
		</ul>
</div>
<?php 
}
?>

<?php 
if($edit === 'videos')
{
?>
<div id="invertedtabs">
		<ul>
		<li style="margin-left: 1px"><a href=edit_listing.php?listing_id=<?php echo $ListingID ?>><span>Listing Details </span></a></li>
		<li><a href=edit_photos_listings.php?listing_id=<?php echo $ListingID ?>><span>(<?php echo $row['total'] ?>) Photos </span></a></li>
		
		
		<li><a href=edit_events.php?listing_id=<?php echo $ListingID ?>><span>Open Houses</span></a></li>	
		<li><a href=preview.php?listing_id=<?php echo $ListingID ?>><span>Preview</span></a></li>	
		<li><a href=view_analytic.php?listing_id=<?php echo $ListingID ?>><span>Analytics</span></a></li>	
		</ul>
</div>
<?php 
}
?>



<?php 
if($edit === 'display')
{
?>
<div id="invertedtabs">
		<ul>
		<li style="margin-left: 1px"><a href=edit_listing.php?listing_id=<?php echo $ListingID ?>><span>Listing Details </span></a></li>
		<li><a href=edit_photos_listings.php?listing_id=<?php echo $ListingID ?>><span>(<?php echo $row['total'] ?>) Photos </span></a></li>
		
		
		<li><a href=edit_events.php?listing_id=<?php echo $ListingID ?>><span>Open Houses</span></a></li>	
		<li id="current"><a href=preview.php?listing_id=<?php echo $ListingID ?>><span>Preview</span></a></li>	
		<li><a href=view_analytic.php?listing_id=<?php echo $ListingID ?>><span>Analytics</span></a></li>	
		</ul>
</div>
<?php 
}
?>
<?php 
if($edit === 'analytic')
{
?>
<div id="invertedtabs">
		<ul>
		<li ><a href=edit_listing.php?listing_id=<?php echo $ListingID ?>><span>Listing Details </span></a></li>
		<li><a href=edit_photos_listings.php?listing_id=<?php echo $ListingID ?>><span>(<?php echo $row['total'] ?>) Photos </span></a></li>
		
		
		<li><a href=edit_events.php?listing_id=<?php echo $ListingID ?>><span>Open Houses</span></a></li>	
		<li><a href=preview.php?listing_id=<?php echo $ListingID ?>><span>Preview</span></a></li>	
		<li id="current" style="margin-left: 1px" ><a href=view_analytic.php?listing_id=<?php echo $ListingID ?>><span>Analytics</span></a></li>	
		</ul>
</div>
<?php 
}
?>